package edu.suda.xsap.dto.convert;

import edu.suda.xsap.dto.MemberDto;
import edu.suda.xsap.entity.Member;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

@Mapper(componentModel = "spring")

public interface MemberConvert {
    @Mapping(source="id", target = "id")
    @Mapping(source="name", target = "name")
    @Mapping(source="sex", target = "gender")
    @Mapping(source="birthday", target = "birth")
    @Mapping(source="note", target = "note")
    @Mapping(source="phone", target = "phone")
    MemberDto toDto(Member member);
    List<MemberDto> toDtoList(List<Member> members);


}
